package com.vne.skyemart.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "Manufacturer",catalog = "skyemart_db")
public class Manufacturer implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 2114457480113340170L;
	
	@Id
	@Column(name = "Manufacturer",nullable = false,unique = true)
	private int manufacturerID;
	
	@Column(name = "Name",nullable = false,length = 250)
	private String name;

	@Column(name = "Website",length = 250)
	private String website;

	@Column(name = "Email",length = 50)
	private String email;

	@Column(name = "Phone",length = 20)
	private String phone;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "manufacturer")
	private Set<Products> Product = new HashSet<Products>(0);
	/**
	 * CONSTRUCTOR
	 * 
	 */
	public Manufacturer() {}
	
	public Manufacturer(int manufacturerID, String name, String website,
			String email, String phone, Set<Products> product) {
		super();
		this.manufacturerID = manufacturerID;
		this.name = name;
		this.website = website;
		this.email = email;
		this.phone = phone;
		Product = product;
	}
	/**
	 * GETTER AND SETTER
	 * 
	 */
	public int getManufacturerID() {
		return manufacturerID;
	}
	public void setManufacturerID(int manufacturerID) {
		this.manufacturerID = manufacturerID;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getWebsite() {
		return website;
	}
	public void setWebsite(String website) {
		this.website = website;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public Set<Products> getProduct() {
		return Product;
	}
	public void setProduct(Set<Products> product) {
		Product = product;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
}
